import request from '@/api/utils/request';
import requestUpload from '@/api/utils/requestUpload';

// 新增考勤时间名称
export const createPeriodName = data =>
  request({
    method: 'post',
    url: '/clockPeriodName/createPeriodName',
    data
  });
// 获取时段名称列表
export const getPeriodNameList = data =>
  request({
    method: 'post',
    url: '/clockPeriodName/getPeriodNameList',
    data
  });

// 删除考勤时间名称
export const deletePeriodName = data =>
  request({
    method: 'post',
    url: '/clockPeriodName/deletePeriodName',
    data
  });
// 导出创建规则错误
export const exportCauseFailure = data =>
  request({
    method: 'post',
    url: '/schClockGroup/exportCauseFailure',
    data,
    responseType: 'blob'
  });
// 删除考勤组规则
export const delectClockGroup = data =>
  request({
    method: 'post',
    url: '/schClockGroup/delectClockGroup',
    data
  });
// 获取考勤组规则
export const getClockGroupList = data =>
  request({
    method: 'get',
    url: '/schClockGroup/getClockGroupList',
    data
  });
// 保存考勤组规则
export const saveClockGroup = data =>
  request({
    method: 'post',
    url: '/schClockGroup/saveClockGroup',
    data
  });
// 获取宿舍管理对接应用是否购买
export const getSchoolApplicationList = data =>
  request({
    method: 'get',
    url: '/schExamineMark/getSchoolApplicationList',
    data
  });

let obsUrl = process.env.VUE_APP_BASE_API + '/file/obs/accessGet';
export const ossAccessGetApi = data => {
  return request({
    url: obsUrl,
    method: 'post',
    data
  });
};

export const uploadFile = data => {
  requestUpload({
    method: 'post',
    data
  });
};
